home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / bitstrg.zip / CLBITARR.C < prev    next >
C/C++ Source or Header  |  1989-06-05  |  482b  |  28 lines

  1. /*
  2.     librairie : bitstrg
  3.  
  4.     clrbitarray --    initialisation a 0 d'un champ de bits
  5.  
  6. */
  7.  
  8. #include "bitstrg.h"
  9.  
  10. /*
  11.     Clear bit array to all 0s
  12. */
  13.  
  14. void clrbitarray(ptr)
  15.     struct SPARRAY * ptr;        /* pointer on structure */
  16. {
  17.  
  18.     unsigned    ind;
  19.  
  20.     ELEBAR*        ptrbit;
  21.  
  22.     ind = (((long)ptr->numlbit + 1) / SIZE)
  23.              + ((((long)ptr->numlbit + 1) & (SIZE - 1)) ? 1 : 0);
  24.      for (ptrbit = ptr -> pntarray ;ind > 0;--ind,++ptrbit) {
  25.         *ptrbit ^= *ptrbit;        /* exclusive-OR */
  26.     }
  27. }
  28.